<?php

class Cat_Tags_Snippet extends Cat_Processor_Monkey_TagBase
{
	function getOutput()
	{		
		$body = $this->getBody();
		
		$pos = mb_strpos( $body, ':' );
		
		if ( $pos === false )
		{
			throw new Exception( 'Snippet has no name' );
		}
		
		$name = trim( mb_substr( $body, 0, $pos ) );
		$snippet = mb_substr( $body, $pos + 2 ); // ": "
		
		$this->getProcessor()->setParam('cat.tags.snippet.' . $name, $snippet);		
		
		return '';
	}
}

?>